﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using DataAccessLayer;

namespace BusinessLayer
{
    public class Get_Category
    {
        public string category { get; set; }

        public Get_Category()
        {
            category = "";
        }

        public Get_Category(string cat)
        {
            category = cat;
        }

        public List<Get_Category> get_category_list()
        {

            List<csparameterListType> par = new List<csparameterListType>();
            List<Get_Category> objlist = new List<Get_Category>();
            DataAccessLayer.csDAL objdal = new DataAccessLayer.csDAL();
            IDataReader datareader = null;

            datareader = objdal.executespreturndr("GET_CATEGORY");
            while (datareader.Read())
            {
                Get_Category objCat = new Get_Category();
                populate_reader(datareader, objCat);
                objlist.Add(objCat);
            }
            return objlist;
        }

        private void populate_reader(IDataReader datareader, Get_Category objCat)
        {
            objCat.category = datareader.GetString(0);
        }
    }
}